<template>
	<div class="home_m">
		<main class="m_product">
			<div class="left_share_quality_content clearfix">
				<div class="share_quality">
					<div class="share_quality_top">
						<div class="share_title">
							<p class="share_text line_height40 color_main_red">为您推荐</p>
						</div>
					</div>
					<div class="share_quality_left not_eng_box">
						<ul>
							<li class="not_eng_item" v-for="item in mainDatas">
								<router-link class="not_eng_link" :to="'/wx/detail/'+item.Id">
									<img v-lazy="root + item.ImgPath" alt="" class="not_eng_pic lazy-img-fadein">
									<div class="not_eng_info" style="padding-top: 10px;">
										<p class="not_eng_title">{{item.ProductName}}</p>
										<p class="not_eng_text">
											<i style="text-decoration: none;font-style: normal;font-size: 12px">¥</i>
											<span class="more_info_price_txt">{{item.MarketPrice}}</span>
										</p>
									</div>
								</router-link>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</main>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				root: this.root,
//				homeDatas: [],
				mainDatas: []
			}
		},
		mounted() {
			let _this = this
			console.log('_this.$router', _this.$router)
			this.getData();
		},
		methods: {
			getData() {
				let _this = this;
				_this.$http.get('/Client/Products', null, localStorage.Authorization, res => {
					console.log('首页res', res)
					if(res.code === 200){
						_this.mainDatas = res.data.list;
					}else if(res.code === 101) {
						localStorage.fromPath = _this.$route.fullPath
						_this.$router.push({
							path: '/wx/login'
						})
					}
				})
			}
		}
	}
</script>
<style>
	img[lazy=error] {
		background: url('../assets/images/err.png');
		background-size: 100% 100%;
	}
</style>
<style scoped="scoped">
	body{
		min-height: 1000px;
	}
	.not_eng_title{
		text-overflow: ellipsis;
		white-space: nowrap;
	}
</style>